import { createRouter, createWebHistory } from 'vue-router'
import LayoutView from '@/views/layout/LayoutView.vue'
import HomeView from '@/views/home/HomeView.vue'
import CartView from '@/views/cart/CartView.vue'
import MyView from '@/views/my/MyView.vue'
import Product from '@/views/shop/ShopView.vue'
import OrderConfirm from '@/views/order/OrderConfirm.vue'
import AddressView from '@/views/address/AddressView.vue'
import OrderView from '@/views/order/OrderView.vue'
import CreateAddressView from '@/views/my/CreateAddressView.vue'

const router = createRouter({
  history:createWebHistory(),
  routes:[
    {
      path:'/',
      name:'LayoutView',
      component:LayoutView,
      redirect:'/home',
      children:[
        {
          path:'/home',
          name:'HomeView',
          component:HomeView
        },
        {
          path:'/cart',
          name:'CartView',
          component:CartView
        },
        {
          path:'/my',
          name:'MyView',
          component:MyView
        },{
          path:'/order',
          name:'OrderView',
          component:OrderView
        }
      ]
    },
    {
      path:'/shop',
      name:'Product',
      component:Product,
    },{
      path:'/orderConfirm',
      component:OrderConfirm
    },{
      path:'/address',
      component:AddressView
    },{
      path:'/createAddressView',
      component:CreateAddressView
    }
  ]
})



export default router
